public class MyCompare {

    public static int compareStudent(Student o1, Student o2) {
        // 先按照年龄升序排序
        if (o1.getAge() == o2.getAge()) {
            // 再按照身高降序排序
            return Double.compare(o2.getHeight(), o1.getHeight());
        }
        
        return o1.getAge() - o2.getAge();
    }
    
    public int compareByAgeDesc(Student o1, Student o2) {
        // 按照年龄降序排序
        return o2.getAge() - o1.getAge();
    }

}
